package com.etoak;

import com.etoak.service.IHelloService;
import com.etoak.service.impl.HelloServiceImpl;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

/**
 * @program: ws-cxf
 * @description:
 * @author: 管浩杰
 * @create: 2021-03-17 17:24
 **/

public class CxfServer {
    public static void main(String[] args) {
        // 创建 JaxWsServerFactoryBean
        JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean();

        /* 服务地址 */
            factoryBean.setAddress("http://localhost:9090/hello?wsdl");
        /* 服务接口 */
            factoryBean.setServiceClass(IHelloService.class);
        /* 服务实现 */
            factoryBean.setServiceBean(new HelloServiceImpl());
        /* 创建服务 并启动服务 */
            Server server = factoryBean.create();
            server.start();
        System.out.println("Server start");

    }
}
